package com.liu.sx.dao;

import com.liu.sx.entity.Worm;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface WormDao extends JpaRepository<Worm,String> , JpaSpecificationExecutor<Worm> {

     Page<Worm> findAll( Pageable pageable);


     @Query(value = "select t from Worm  t where t.address like concat('%',:query,'%') ")
     Page<Worm> findAll(String  query,Pageable pageable);

}
